<?php
/**
 * Created by IntelliJ IDEA.
 * User: XD
 * Date: 2017/8/21
 * Time: 16:24
 */

//动态性的介绍 php动态语言特性
 class classname{
     function __construct(){
         echo __METHOD__,"\n";
     }
 }
 function funcname()
 {
     echo __FUNCTION__,"\n";
 }
 const constname = "global";

 $a = 'classname';
 $obj = new $a;  // prints classname::__construct
 $b = 'funcname';
 $b();   // prints funcname
 echo constant('constname',"\n");  // prints global

?>